const sq = require('./index');
const { DataTypes } = require('sequelize');
const userGroupMessage = sq.define('userGroupMessage', {
    userId: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: "用户的id的值"
    },
    userCommendName: {
        type: DataTypes.STRING,
        comment: "表示当前用户在群聊显示的备注名字"
    },
    groupId: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: "群聊的id"
    },
    groupName: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: "表示当前用户给这个群聊的名字"
    },
    isShowGroupMessage: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: true,
        comment: "当前用户是否展示这个群聊天"
    },
    messageLastdate: {
        type: DataTypes.INTEGER,
        comment: "上次聊天的id"
    },
    noMessageNum: {
        type: DataTypes.INTEGER,
        defaultValue: 0,
        require: true,
        comment: "消息未读的数量"
    },
}, {
    freezeTableName: true,
});
//userGroupMessage.sync({ force: true })
module.exports = userGroupMessage; 